package com.leadingsoft.web.controller;

import javax.servlet.http.HttpServletRequest;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import com.leadingsoft.common.toolkit.Constant;
import com.leadingsoft.core.model.KUser;
import com.leadingsoft.web.service.VariableService;
import com.leadingsoft.web.utils.JsonUtils;

@RestController
@RequestMapping("/variable/")
public class VariableController {
    @Autowired
    private VariableService variableService;
    
    @RequestMapping("getSimpleList.shtml")
    public String simpleList(HttpServletRequest request){
        KUser kUser = (KUser) request.getSession().getAttribute(Constant.SESSION_ID);
        return JsonUtils.objectToJson(variableService.getList(kUser.getuId()));
    }
}
